package com.steel.yfmall.cloud.assistant.listener;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.steel.yfmall.cloud.assistant.po.view.OutCallApiLogBean;
import com.steel.yfmall.cloud.assistant.user.UserBaseService;
import com.steel.yfmall.cloud.assistant.utils.kd.AccessToken;
import com.steel.yfmall.cloud.assistant.utils.kd.AppToken;
import com.steel.yfmall.cloud.components.mq.bean.RequestSendMQBean;
import com.steel.yfmall.cloud.components.mq.service.MqSendService;
import com.steel.yfmall.cloud.components.mq.service.impl.MqSendServiceImpl;
import com.steel.yfmall.cloud.components.utils.base.BaseServiceSearchBean;
import com.steel.yfmall.cloud.user.api.bean.param.APIParaUserBase;
import com.steel.yfmall.cloud.user.api.bean.param.APIParaUserCompany;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;
import sun.net.www.http.HttpClient;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@Slf4j
@Component
public class UserInfoAPIListener {
    @Value("${app_url}")
    private String APP_URL;
    @Value("${access_url}")
    private String ACCESS_URL;
    private String password = "";
    private String accessType = "login.do";
    private String appType = "getAppToken.do";


    //获取appToken参数及结果变量
    private String apptoken = "";
    @Value("${appId}")
    private String appId;//开放平台第三方API系统编码
    @Value("${appSecuret}")
    private String appSecuret;//开放平台第三方API系统密码
    @Value("${tenantid}")
    private String tenantid;//租户中心id
    private String accountId = "";//租户中心数据中心ID
    @Value("${language}")
    private String language;//获取AppToken所用参数
    //获取accessToken参数及结果变量
    private String accessToken = "";
    @Value("${accessuser}")
    private String accessuser;
    @Value("${userType}")
    private String userType;
    @Value("${cq_url}")
    private String CQ_URL;
    @Value("${customer_Apply}")
    private String param;
    private String methodno;
    private String methodname;
    @Resource
    private MqSendService mqSendService;
    @Resource
    private UserBaseService userBaseService;

    @JmsListener(destination = "user_push_info")
    public void user_push_info(String userinfo) {
        OutCallApiLogBean paraBean = null;
        String url = CQ_URL + "/" + param;
        try {
            this.apptoken = "";
            this.accessToken = "";
            log.info("测试用户信息:" + userinfo);
            //获取appToken
            this.apptoken = GetAPPToken();
            //获取accessToken
            this.accessToken = getAccessToken();
            //开始执行存储到苍穹平台客户数据
            log.info("获取accessToken后，开始执行电商注册数据");
            String nowuserinfo = userinfo.replace("\r\n", "");
            JSONObject jsonObject = JSONObject.parseObject(nowuserinfo);
            String username = jsonObject.getString("userName");
            JSONObject obj = jsonObject.getJSONObject("apiParaUserCompany");
            if (obj == null) {
                obj = new JSONObject();
            }
            APIUserBase base = GetUserBase(jsonObject, obj);

            String str = "";
            str = GetPostJson(str, base);

            url = url + "?access_token=" + this.accessToken;
            this.methodno = "dc_DSAPI-yfgt_bd_customer_applyNew_PUSH";
            this.methodname = "电商注册客户推送到苍穹平台";
            String msg = GetHttpMsg(str, url);
            log.info(getResult(msg));
        } catch (Exception e) {
            log.error("新增对外接口访问日志失败: ", e);
        }
    }

    private String getResult(String res) {
        String str = "";
        JSONObject obj = JSONObject.parseObject(res);
        boolean success = obj.getBoolean("success");
        if (!success) {
            str = "error_desc:" + obj.getString("error_desc") + ",error_code=" + obj.getString("error_desc");
        }
        return str;
    }

    private String getHttpJsonData(String loginType, String res) {
        String str = "";
        JSONObject jsonObject = JSONObject.parseObject(res);
        JSONObject obj = jsonObject.getJSONObject("data");
        boolean sucess = obj.getBoolean("success");
        if (sucess) {
            if (loginType.equals(appType)) {
                str = obj.getString("app_token");
            } else if (loginType.equals(accessType)) {
                str = obj.getString("access_token");
            }

        }
        return str;
    }

    private APIUserBase GetUserBase(JSONObject obj, JSONObject obj1) {
        APIUserBase user = new APIUserBase();
        user.setUserName(this.GetStr(obj, "userName"));
        user.setNickName(this.GetStr(obj, "userName"));
        user.setMobile("+86-" + this.GetStr(obj, "mobile"));
        user.setAddress(this.GetStr(obj, "address"));
        user.setIdCard(this.GetStr(obj, "idCard"));
        user.setFullPhoto(this.GetStr(obj, "fullPhoto"));
        user.setReversePhoto(this.GetStr(obj, "reversePhoto"));
        user.setUserType(this.GetInt(obj, "userType"));
        user.setParentUserName(this.GetStr(obj, ""));
        user.setDeductionUserName(this.GetStr(obj, ""));
        user.setAssociatefirstlevelUserName(this.GetStr(obj, ""));
        user.setLookProdClass(this.GetStr(obj, ""));
        user.setLookAddress(this.GetStr(obj, ""));
        user.setPassword(this.GetStr(obj, "password"));
        user.setPassword2(this.GetStr(obj, "password2"));
        user.setRegIp(this.GetStr(obj, "regIp"));
        user.setSiteCode(this.GetStr(obj, "siteCode"));
        user.setChannelType(this.GetInt(obj, "channelType"));
        user.setCheckMobile(this.GetInt(obj, "checkMobile"));
        user.setParentUserName("");
        APIParaUserCompany company = new APIParaUserCompany();
        user.setBank(this.GetStr(obj1, "bank"));
        user.setBankAccount(this.GetStr(obj1, "bankAccount"));
        user.setBdName(this.GetStr(obj1, "bdName"));
        user.setBdPhone(this.GetStr(obj1, "bdPhone"));
        user.setChannelType(this.GetInt(obj1, "channelType"));
        user.setCompanyAddress(this.GetStr(obj1, "companyAddress"));
        user.setCompanyLicenseUrl(this.GetStr(obj1, "companyLicenseUrl"));
        user.setCompanyName(this.GetStr(obj1, "companyName"));
        user.setContractAddress(this.GetStr(obj1, "contractAddress"));
        user.setContractPhone(this.GetStr(obj1, "contractPhone"));
        user.setContractContact(this.GetStr(obj1, "contractContact"));
        user.setCorporation(this.GetStr(obj1, "corporation"));
        user.setGeneralTaxpayerType(this.GetStr(obj1, "generalTaxpayerType"));
        user.setGeneralTaxpayerUrl(this.GetStr(obj1, "generalTaxpayerUrl"));
        user.setInvoiceAddress(this.GetStr(obj1, "invoiceAddress"));
        user.setInvoicePhone(this.GetStr(obj1, "invoicePhone"));
        user.setInvoicingInfo(this.GetStr(obj1, "invoicingInfo"));
        user.setInvoicingContact(this.GetStr(obj1, "invoicingContact"));
        user.setOfficeAddress(this.GetStr(obj1, "officeAddress"));
        user.setContractDetails(this.GetStr(obj, "contactDetails"));
//        company.setOfficeHeadUrl(this.GetStr(obj1,"officeHeadUrl"));
//        company.setOutboundOrderUrl(this.GetStr(obj1,"outboundOrderUrl"));
        user.setTaxpayerIdentificationNumber(this.GetStr(obj1, "taxpayerIdentificationNumber"));
        if (user.getUserType() == 0) {
            user.setTaxpayerIdentificationNumber(user.getMobile());
        }
        if (user.getUserType() == 1) {
            user.setNickName(user.getCompanyName());
        }
        List<Bank> banks = GetBanks(user);
        user.setBanks(banks);
        List<Address> addresses = GetAddress(user);
        user.setAddresses(addresses);
        //user.setApiParaUserCompany(company);
        List<Liaison> liaisons = GetLiaisons(user);
        user.setLiaisons(liaisons);
        return user;
    }

    private List<Bank> GetBanks(APIUserBase user) {
        List<Bank> list = new ArrayList<>();
        Bank bank = new Bank();
        bank.setBank(user.getBank());
        bank.setBankAccount(user.getBankAccount());
        bank.setAccountName(user.getBankAccount());
        list.add(bank);
        return list;
    }

    //获取
    private List<Liaison> GetLiaisons(APIUserBase user) {
        List<Liaison> list = new ArrayList<>();
        Liaison l = new Liaison();
        l.setRoleType("1");
        l.setUserName(user.getBdName());
        l.setMobile(user.getBdPhone());
        l.setAddress(user.getOfficeAddress());
        list.add(l);
        l = new Liaison();
        l.setRoleType("2");
        l.setUserName(user.getInvoicingContact());
        l.setMobile(user.getInvoicePhone());
        l.setAddress(user.getInvoiceAddress());
        list.add(l);
        l = new Liaison();
        l.setRoleType("3");
        l.setUserName(user.getContractContact());
        l.setMobile(user.getContractPhone());
        l.setAddress(user.getContractAddress());
        list.add(l);
        return list;
    }

    private List<Address> GetAddress(APIUserBase user) {
        List<Address> list = new ArrayList<>();
        Address address = new Address();
        address.setAddress(user.getCompanyAddress());
        address.setFullAddress(user.getCompanyAddress());
        address.setTellphone(user.getMobile());
        list.add(address);
        return list;
    }

    public String GetPostJson(String str, APIUserBase user) {
        StringBuffer json = new StringBuffer();
        JSONObject obj = new JSONObject();
        obj.put("data", user);
        str = obj.toString();
        log.info("需要插入的数据：" + str);
        return str;
    }

    private String getAccessToken() {
        String postparam = JSON.toJSONString(new AccessToken(this.accessuser, this.apptoken, this.tenantid, this.accountId, this.userType));
        log.info("获取accessToken所用参数:" + postparam);
        this.methodno = accessType;
        this.methodname = "获取AccessToke";
        String res = GetHttpMsg(postparam, ACCESS_URL);
        this.accessToken = getHttpJsonData(accessType, res);
        log.info("获取accessToken结果:" + this.accessToken);
        return this.accessToken;
    }

    private String GetAPPToken() {
        String postparam = JSON.toJSONString(new AppToken(this.appId, this.appSecuret, this.tenantid, this.accountId, this.language));
        log.info("获取appToken所用参数:" + postparam);
        this.methodno = appType;
        this.methodname = "获取AppToke";
        String res = GetHttpMsg(postparam, APP_URL);
        this.apptoken = getHttpJsonData(appType, res);
        log.info("获取appToken结果:" + this.apptoken);
        return this.apptoken;
    }

    private String GetHttpMsg(String str, String url) {
        log.info("HttpClient的URL=" + url + ",参数:" + str);
        HttpPost httpPost = new HttpPost(url);
        CloseableHttpClient client = HttpClients.createDefault();
        String respContent = null;
        StringEntity entity = new StringEntity(str, "utf-8");//解决中文乱码问题
        //System.out.println(entity.toString());
        entity.setContentEncoding("UTF-8");
        entity.setContentType("application/json");
        httpPost.setEntity(entity);
        try {
            HttpResponse resp = client.execute(httpPost);
            System.out.println(resp.getStatusLine().getStatusCode());
            if (resp.getStatusLine().getStatusCode() == 200) {
                HttpEntity he = resp.getEntity();
                respContent = EntityUtils.toString(he, "UTF-8");
            }
            OutCallApiLogBean outCallApiLogBean = new OutCallApiLogBean();
            outCallApiLogBean.setApiUrl(url);
            outCallApiLogBean.setParaText(str);
            outCallApiLogBean.setInterfaceMethod(this.methodno);
            outCallApiLogBean.setInterfaceMethodName(this.methodname);
            RequestSendMQBean requestSendMQBean = new RequestSendMQBean();
            requestSendMQBean.setSendMqTitle("insert_out_call_api_log");

            requestSendMQBean.setSendMqMessage(JSON.toJSONString(outCallApiLogBean));
            mqSendService.sendCommonMQMessage(requestSendMQBean);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        log.info("HTTPClient请求结果:" + respContent);
        return respContent;
    }

    private String GetStr(JSONObject obj, String str) {
        String s = "";
        if (obj.getString(str) != null) {
            s = obj.getString(str);
        }
        return s;
    }

    private int GetInt(JSONObject obj, String str) {
        int s = 0;
        if (obj.getString(str) != null && !"".equals(obj.getString(str))) {
            s = obj.getInteger(str);
        }
        return s;
    }

    private Object GetObject(JSONObject obj, String str) {
        Object object = null;
        if (obj.getString(str) != null) {
            obj = obj.getJSONObject(str);
        }
        return object;
    }

}

class APIUserBase extends BaseServiceSearchBean {
    /**
     * @Fields user_name 登录用户名 J开头
     */
    private String userName;

    /**
     * @Fields password 用户密码
     */
    private String password;

    /**
     * @Fields password 用户密码
     */
    private String password2;

    /**
     * @Fields nick_name 用户昵称
     */
    private String nickName;

    /**
     * @Fields salt 加盐
     */
    private String salt;

    /**
     * @Fields mobile 用户手机号
     */
    private String mobile;

    /**
     * @Fields address 地址
     */
    private String address;

    /**
     * @Fields id_card 身份证号
     */
    private String idCard;

    /**
     * @Fields full_photo 身份证正面照
     */
    private String fullPhoto;

    /**
     * @Fields reverse_photo 身份证反面照
     */
    private String reversePhoto;

    /**
     * @Fields status 用户状态  -1为删除，0为未审核，1为已审核，2为已激活
     */
    private Integer status;


    /**
     * @Fields reg_ip 注册IP
     */
    private String regIp;

    /**
     * @Fields last_login_ip 最后一次登录ID
     */
    private String lastLoginIp;

    /**
     * @Fields check_mobile 是否验证手机   1 验证过 2未验证
     */
    private Integer checkMobile;


    /**
     * @Fields user_type 会员类型(0个人用户、1企业用户)
     */
    private Integer userType;

    /**
     * @Fields site_code 默认站点 SDYFJT
     */
    private String siteCode;

    /**
     * 访问token
     */
    private String token;

    /**
     * 加密code
     */
    private String code;

    /**
     * 验证码
     */
    private String verificationCode;

    /**
     * 旧密码，找回密码时使用
     */
    private String oldPassword;

    /**
     * 短信模板编码
     */
    private String smsCode;

    /**
     * 标识   1 表示苍穹 推送的数据
     */
    private int flag;

    /**
     * @Fields parent_user_name 父级登陆账号（托盘）
     */
    private String parentUserName;

    /**
     * @Fields deduction_user_name 抵扣账户的主账号
     */
    private String deductionUserName;

    /**
     * @Fields associateFirstLevel_user_name 关联本身一级主账号
     */
    private String associatefirstlevelUserName;
    /**
     * 联系方式
     */
    private String contractDetails;

    public String getContractDetails() {
        return contractDetails;
    }

    public void setContractDetails(String contractDetails) {
        this.contractDetails = contractDetails;
    }

    /**
     * @Fields look_prod_class 可查看产品大类编码，多个逗号分割
     */
    private String lookProdClass;

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPassword2() {
        return password2;
    }

    public void setPassword2(String password2) {
        this.password2 = password2;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getIdCard() {
        return idCard;
    }

    public void setIdCard(String idCard) {
        this.idCard = idCard;
    }

    public String getFullPhoto() {
        return fullPhoto;
    }

    public void setFullPhoto(String fullPhoto) {
        this.fullPhoto = fullPhoto;
    }

    public String getReversePhoto() {
        return reversePhoto;
    }

    public void setReversePhoto(String reversePhoto) {
        this.reversePhoto = reversePhoto;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getRegIp() {
        return regIp;
    }

    public void setRegIp(String regIp) {
        this.regIp = regIp;
    }

    public String getLastLoginIp() {
        return lastLoginIp;
    }

    public void setLastLoginIp(String lastLoginIp) {
        this.lastLoginIp = lastLoginIp;
    }

    public Integer getCheckMobile() {
        return checkMobile;
    }

    public void setCheckMobile(Integer checkMobile) {
        this.checkMobile = checkMobile;
    }

    public Integer getUserType() {
        return userType;
    }

    public void setUserType(Integer userType) {
        this.userType = userType;
    }

    @Override
    public String getSiteCode() {
        return siteCode;
    }

    @Override
    public void setSiteCode(String siteCode) {
        this.siteCode = siteCode;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getVerificationCode() {
        return verificationCode;
    }

    public void setVerificationCode(String verificationCode) {
        this.verificationCode = verificationCode;
    }

    public String getOldPassword() {
        return oldPassword;
    }

    public void setOldPassword(String oldPassword) {
        this.oldPassword = oldPassword;
    }

    public String getSmsCode() {
        return smsCode;
    }

    public void setSmsCode(String smsCode) {
        this.smsCode = smsCode;
    }

    public int getFlag() {
        return flag;
    }

    public void setFlag(int flag) {
        this.flag = flag;
    }

    public String getParentUserName() {
        return parentUserName;
    }

    public void setParentUserName(String parentUserName) {
        this.parentUserName = parentUserName;
    }

    public String getDeductionUserName() {
        return deductionUserName;
    }

    public void setDeductionUserName(String deductionUserName) {
        this.deductionUserName = deductionUserName;
    }

    public String getAssociatefirstlevelUserName() {
        return associatefirstlevelUserName;
    }

    public void setAssociatefirstlevelUserName(String associatefirstlevelUserName) {
        this.associatefirstlevelUserName = associatefirstlevelUserName;
    }

    public String getLookProdClass() {
        return lookProdClass;
    }

    public void setLookProdClass(String lookProdClass) {
        this.lookProdClass = lookProdClass;
    }

    public String getLookAddress() {
        return lookAddress;
    }

    public void setLookAddress(String lookAddress) {
        this.lookAddress = lookAddress;
    }

    /**
     * @Fields look_address 可查看终到地区，多个逗号分割
     */

    private String lookAddress;
    private String companyLicenseUrl;
    private String corporation;
    private String invoicingInfo;
    private String companyName;
    private String companyCode;
    private String companyAddress;
    private String taxpayerIdentificationNumber;
    private String bank;
    private String bankAccount;
    private String bdName;
    private String bdPhone;
    private String officeAddress;
    private String invoicingContact;
    private String invoiceAddress;
    private String invoicePhone;
    private String contractContact;
    private String contractPhone;
    private String contractAddress;
    private String generalTaxpayerType;
    private String generalTaxpayerUrl;
    private Integer id;

    public Integer getId() {
        return this.id;
    }

    public String getUserName() {
        return this.userName;
    }

    public String getMobile() {
        return this.mobile;
    }

    public String getCompanyLicenseUrl() {
        return this.companyLicenseUrl;
    }

    public String getCorporation() {
        return this.corporation;
    }

    public String getInvoicingInfo() {
        return this.invoicingInfo;
    }

    public String getCompanyName() {
        return this.companyName;
    }

    public String getCompanyCode() {
        return this.companyCode;
    }

    public String getCompanyAddress() {
        return this.companyAddress;
    }

    public String getTaxpayerIdentificationNumber() {
        return this.taxpayerIdentificationNumber;
    }

    public String getBank() {
        return this.bank;
    }

    public String getBankAccount() {
        return this.bankAccount;
    }

    public String getBdName() {
        return this.bdName;
    }

    public String getBdPhone() {
        return this.bdPhone;
    }

    public String getOfficeAddress() {
        return this.officeAddress;
    }

    public String getInvoicingContact() {
        return this.invoicingContact;
    }

    public String getInvoiceAddress() {
        return this.invoiceAddress;
    }

    public String getInvoicePhone() {
        return this.invoicePhone;
    }

    public String getContractContact() {
        return this.contractContact;
    }

    public String getContractPhone() {
        return this.contractPhone;
    }

    public String getContractAddress() {
        return this.contractAddress;
    }

    public String getGeneralTaxpayerType() {
        return this.generalTaxpayerType;
    }

    public String getGeneralTaxpayerUrl() {
        return this.generalTaxpayerUrl;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public void setCompanyLicenseUrl(String companyLicenseUrl) {
        this.companyLicenseUrl = companyLicenseUrl;
    }

    public void setCorporation(String corporation) {
        this.corporation = corporation;
    }

    public void setInvoicingInfo(String invoicingInfo) {
        this.invoicingInfo = invoicingInfo;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public void setCompanyCode(String companyCode) {
        this.companyCode = companyCode;
    }

    public void setCompanyAddress(String companyAddress) {
        this.companyAddress = companyAddress;
    }

    public void setTaxpayerIdentificationNumber(String taxpayerIdentificationNumber) {
        this.taxpayerIdentificationNumber = taxpayerIdentificationNumber;
    }

    public void setBank(String bank) {
        this.bank = bank;
    }

    public void setBankAccount(String bankAccount) {
        this.bankAccount = bankAccount;
    }

    public void setBdName(String bdName) {
        this.bdName = bdName;
    }

    public void setBdPhone(String bdPhone) {
        this.bdPhone = bdPhone;
    }

    public void setOfficeAddress(String officeAddress) {
        this.officeAddress = officeAddress;
    }

    public void setInvoicingContact(String invoicingContact) {
        this.invoicingContact = invoicingContact;
    }

    public void setInvoiceAddress(String invoiceAddress) {
        this.invoiceAddress = invoiceAddress;
    }

    public void setInvoicePhone(String invoicePhone) {
        this.invoicePhone = invoicePhone;
    }

    public void setContractContact(String contractContact) {
        this.contractContact = contractContact;
    }

    public void setContractPhone(String contractPhone) {
        this.contractPhone = contractPhone;
    }

    public void setContractAddress(String contractAddress) {
        this.contractAddress = contractAddress;
    }

    public void setGeneralTaxpayerType(String generalTaxpayerType) {
        this.generalTaxpayerType = generalTaxpayerType;
    }

    public void setGeneralTaxpayerUrl(String generalTaxpayerUrl) {
        this.generalTaxpayerUrl = generalTaxpayerUrl;
    }

    public List<Bank> banks;

    public List<Bank> getBanks() {
        return banks;
    }

    public void setBanks(List<Bank> banks) {
        this.banks = banks;
    }

    private List<Address> addresses;

    public List<Address> getAddresses() {
        return addresses;
    }

    public void setAddresses(List<Address> addresses) {
        this.addresses = addresses;
    }

    private List<Liaison> liaisons;

    public List<Liaison> getLiaisons() {
        return liaisons;
    }

    public void setLiaisons(List<Liaison> liaisons) {
        this.liaisons = liaisons;
    }

    private String regTime;

    public String getRegTime() {
        return regTime;
    }

    public void setRegTime(String regTime) {
        this.regTime = regTime;
    }
}

class Bank {
    private String bank;//开户银行
    private String bankAccount;//账号
    private String accountName;//账号名称
    private String interAccount;//国际银行账号

    public String getBank() {
        return bank;
    }

    public void setBank(String bank) {
        this.bank = bank;
    }

    public String getBankAccount() {
        return bankAccount;
    }

    public void setBankAccount(String bankAccount) {
        this.bankAccount = bankAccount;
    }

    public String getAccountName() {
        return accountName;
    }

    public void setAccountName(String accountName) {
        this.accountName = accountName;
    }

    public String getInterAccount() {
        return interAccount;
    }

    public void setInterAccount(String interAccount) {
        this.interAccount = interAccount;
    }
}

class Address {
    private String fullAddress;
    private String address;
    private String tellphone;

    public String getFullAddress() {
        return fullAddress;
    }

    public void setFullAddress(String fullAddress) {
        this.fullAddress = fullAddress;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getTellphone() {
        return tellphone;
    }

    public void setTellphone(String tellphone) {
        this.tellphone = tellphone;
    }
}

class Liaison {
    private String roleType;//角色
    private String userName;
    private String sex;
    private String deptno;
    private String title;
    private String mobile;
    private String tellphone;
    private String address;
    private String email;

    public String getRoleType() {
        return roleType;
    }

    public void setRoleType(String roleType) {
        this.roleType = roleType;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getDeptno() {
        return deptno;
    }

    public void setDeptno(String deptno) {
        this.deptno = deptno;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getTellphone() {
        return tellphone;
    }

    public void setTellphone(String tellphone) {
        this.tellphone = tellphone;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }
}

